import request from '@/utils/request'

// 查询列表
export function listApplydan(query) {
  return request({
    url: '/system/applydan/list',
    method: 'get',
    params: query
  })
}

// 查询流程角色任务
export function findList(data) {
  console.log("js:"+data.assignee);
  return request({
    url: '/system/applydan/find',
    method: 'post',
    data: data
  })
}

// 流程审批通过
export function agree(data) {
  console.log("js:"+data);
  return request({
    url: '/system/applydan/agree',
    method: 'post',
    data: data
  })
}

// 流程审批驳回
export function reject(data) {
  console.log("js:"+data);
  return request({
    url: '/system/applydan/reject',
    method: 'post',
    data: data
  })
}

// 流程图生成
export function build(data) {
  console.log("processInstanceId:"+data);
  return request({
    url: '/system/applydan/processDiagram',
    method: 'post',
    data: data
  })
}

// 查询
export function getApplydan(id) {
  return request({
    url: '/system/applydan/' + id,
    method: 'get'
  })
}

// 新增
export function addApplydan(data) {
  console.log("data:"+data);
  return request({
    url: '/system/applydan',
    method: 'post',
    data: data
  })
}

// 修改
export function updateApplydan(data) {
  return request({
    url: '/system/applydan',
    method: 'put',
    data: data
  })
}

// 删除
export function delApplydan(id) {
  return request({
    url: '/system/applydan/' + id,
    method: 'delete'
  })
}
